<?php
/*
 * 图片显示 处理逻辑文件
 * @package    auto
 * @author     Mark
 * @copyright  Copyright (c) 2013 ixdcw team
 * @version    $Id: ae7523315e995a655b15606d919ee47a9a71256a $
 */

defined('IN_IXDCW') or exit('Access Denied');
require_once DT_CORE . "/{$module}/common.inc.php";

// header
$headerPart = 'pic';
require_once MD_ROOT . '/header.inc.php';


$carRelation   = AutoCar::relation($carId, 8);
$carAttention  = AutoCar::attention($carId, 8);
$carOnsale     = AutoBrand::manusAndCars($brandId, array('tc.issale=1'));

//筛选:车款amid
if(isset($modelid) && $modelid!=0) $amid = $modelid;

//筛选：类别区间alid
if(isset($t) && $t!=0) $alid = $t;

//输出
$AutoPicture = AutoPicture::getPictures($carId,$amid,$alid);

//print_r($AutoPicture);

//图片筛选条件:在售车款型号
$searchSellModel = AutoPicture::getPicModelSearch($carId,'1');
$ModelOnShow=0;
foreach($searchSellModel as $key=>$value){
	if(isset($value[$amid])){
		$ModelOnShow=1;
	}
}
$sellNum = $num;    //统计在售

//图片筛选条件:停售车款型号
$searchStopModel = AutoPicture::getPicModelSearch($carId,'0');
foreach($searchStopModel as $key=>$value){
	if(isset($value[$amid])){
		$ModelOnShow=2;
	}
}
$stopNum = $num;



//车款筛选条件：外观、内饰等
foreach(AutoPicture::getPicTypeSearch($carId,$amid) as $val) {
	if($val['pics']) {
		$searchType[$val['arid']] = $val['name'];
	}
}



$pn = new Pagination();
$pagesize = 8;
$pn->padding(false);
$pn->records_per_page($pagesize);
$pn->records($items);



include template('pictureList',$module);